home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 2.1 KB | 111 lines | [TEXT/CWIE] |
- /*
- File: AppleEventStuff.c
-
- Contains: Handlers for the 4 "required" events
-
- Written by: Chris White, Developer Technical Support
-
- Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- 1/22/96 CW First release
-
- */
-
-
-
-
- // System Includes
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
-
-
-
- // Application includes
-
- #ifndef __BAREBONES__
- #include "BareBones.h"
- #endif
-
- #ifndef __PROTOTYPES__
- #include "Prototypes.h"
- #endif
-
-
-
-
-
- // Static Prototypes
- static pascal OSErr HandleOapp ( AEDescList* aevt, AEDescList* reply, long refCon );
- static pascal OSErr HandleQuit ( AEDescList* aevt, AEDescList* reply, long refCon );
- static pascal OSErr HandleOdoc ( AEDescList* aevt, AEDescList* reply, long refCon );
- static pascal OSErr HandlePdoc ( AEDescList* aevt, AEDescList* reply, long refCon );
-
-
-
- #pragma segment Initialize
-
- OSErr InstallAppleEventHandlers ( void )
- {
- OSErr theErr;
-
-
- theErr = AEInstallEventHandler ( kCoreEventClass, kAEOpenApplication, NewAEEventHandlerProc ( HandleOapp ), 0, false );
- if ( theErr ) goto CleanupAndBail;
-
- theErr = AEInstallEventHandler ( kCoreEventClass, kAEOpenDocuments, NewAEEventHandlerProc ( HandleOdoc ), 0, false );
- if ( theErr ) goto CleanupAndBail;
-
- theErr = AEInstallEventHandler ( kCoreEventClass, kAEPrintDocuments, NewAEEventHandlerProc ( HandlePdoc ), 0, false );
- if ( theErr ) goto CleanupAndBail;
-
- theErr = AEInstallEventHandler ( kCoreEventClass, kAEQuitApplication, NewAEEventHandlerProc ( HandleQuit ), 0, false );
- if ( theErr ) goto CleanupAndBail;
-
-
- CleanupAndBail:
-
- return theErr;
-
- } // InstallAppleEventHandlers
-
-
-
- #pragma segment Core
-
- static pascal OSErr HandleOapp ( AEDescList* aevt, AEDescList* reply, long refCon )
- {
- return errAEEventNotHandled;
- }
-
-
-
- static pascal OSErr HandleOdoc ( AEDescList* aevt, AEDescList* reply, long refCon )
- {
- return errAEEventNotHandled;
- }
-
-
-
- static pascal OSErr HandlePdoc ( AEDescList* aevt, AEDescList* reply, long refCon )
- {
- return errAEEventNotHandled;
- }
-
-
-
- static pascal OSErr HandleQuit ( AEDescList* aevt, AEDescList* reply, long refCon )
- {
- gQuit = true;
-
- return noErr;
- }
-
-
-
-
-